from MyTelloLib.MyTello import MyTello
from MyTelloLib.TelloCV import TelloCV

tello = MyTello('192.168.10.2')
telloCV = TelloCV(tello)
telloCV.init_face_tracker()

tello.takeoff().wait_for_completed()

while True:
    frame = tello.get_video_frame()
    if frame is not None:
        x, y, z, img = telloCV.face_position(frame)
        telloCV.xyz_control(x, y, z, 15, 50)
        if telloCV.show(img):
            break

tello.land().wait_for_completed()
tello.quit()
del telloCV
del tello
